arm: smccc: handle SMCs according to SMCCC
authorVolodymyr Babchuk <volodymyr_babchuk@epam.com>
Tue, 10 Oct 2017 15:52:47 +0000 (18:52 +0300)
committerStefano Stabellini <sstabellini@kernel.org>
Wed, 11 Oct 2017 19:42:03 +0000 (12:42 -0700)
commit9255ede2a2b1a7f34b84474d5313d38eb822842b
treedb51ef7d385056d92a54bb30825eb824a3cd82e9
parent0b0d9df527410b95105cb01c8b747e9b60ed0642
arm: smccc: handle SMCs according to SMCCC

SMCCC (SMC Call Convention) describes how to handle both HVCs and SMCs.
SMCCC states that both HVC and SMC are valid conduits to call to different
firmware functions. Thus, for example, PSCI calls can be made both by
SMC or HVC. Also SMCCC defines function number coding for such calls.
Besides functional calls there are query calls, which allows underling
OS determine version, UUID and number of functions provided by service
provider.

This patch adds new file `vsmc.c`, which handles both generic SMCs
and HVC according to SMCCC. At this moment it implements only one
service: Standard Hypervisor Service.

At this time Standard Hypervisor Service only supports query calls,
so caller can ask about hypervisor UID and determine that it is XEN running.

This change allows more generic handling for SMCs and HVCs and it can
be easily extended to support new services and functions.

But, before SMC is forwarded to standard SMCCC handler, it can be routed
to a domain monitor, if one is installed.

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Acked-by: Julien Grall <julien.grall@arm.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/Makefile
xen/arch/arm/traps.c
xen/arch/arm/vsmc.c [new file with mode: 0644]
xen/include/asm-arm/traps.h
xen/include/public/arch-arm/smccc.h [new file with mode: 0644]